<template>
  <div class="home-banner">
    <me-banner>
      <swiper-slide
      v-for="(item, index) of bannerList"
      :key="index">
        <a :href="item.linkUrl" class="banner-link">
          <img :src="item.picUrl" alt="" class="banner-img">
        </a>
      </swiper-slide>
    </me-banner>
  </div>
</template>
<script>
import meBanner from '@/base/me-banner'
import { getBannerInfo } from '@/api/home.js'
export default {
  name: 'homeBanner',
  components: {
    meBanner
  },
  created () {
    this.getInfo()
  },
  data () {
    return {
      bannerList: []
    }
  },
  methods: {
    getInfo () {
      return getBannerInfo().then(data => {
        this.bannerList = data
      })
    },
    update () { // 刷新轮播图
      return this.getInfo()
    }
  }
}
</script>
<style lang="stylus" scoped>
.home-banner
    width 100%
    height 0
    padding-bottom 48.8%
    // .banner-linkUrl
    // // width 100%
    // // height 100%

    // display block
    .banner-img
      width 100%
      height 100%
</style>
